package com.ziyucoding.springboot.labs.lab10.seatdemo.tccscfeign.orderservice.feign;

import com.ziyucoding.springboot.labs.lab10.seatdemo.tccscfeign.orderservice.feign.dto.TransactionalRecordSaveDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 事务记录服务 Feign 端
 *
 * @author ziyucoding
 * @date 2022-11-06
 **/
@FeignClient(name = "tcc-transactional-record-service")
public interface TransactionalRecordServiceFeignClient {

    @PostMapping("/transactional-record/save")
    Map<String, Object> saveTransactionalRecord(@RequestBody TransactionalRecordSaveDTO dto);

    @GetMapping("/transactional-record/find-by-id")
    Map<String, Object> findTransactionalRecordByXid(@RequestParam("xid") String xid);
}
